#!/bin/bash
LANG=en_US.UTF-8
url=https://gitee.com/pj-xiaoyu/YMD
path=/usr/YMD

rm -rf ${path}/version2.txt
cd ${path}&&wget ${url}/raw/master/version.txt -O version2.txt
z=`cat ${path}/version.txt`
v=`cat ${path}/version2.txt`
A="$v"
B="$z"
if [[ $A == $B ]]
then
  rm -rf ${path}/version2.txt  
else
  rm -rf ${path}/version.txt 
  bash -c "$(wget ${url}/raw/master/YMDversion.sh -O -)"
  mv -f ${path}/version2.txt ${path}/version.txt
  bash /root/YMD/YMDversion.sh
fi
